package com.example.service.flowable;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.mapper.EmpMapper;
import com.example.pojo.Emp;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * flowable服务抽象类
 * @author wsl
 */
public abstract class FlowableServiceAbstract {

    public FlowableServiceAbstract() {
    }

    public FlowableServiceAbstract(String processDefinitionId) {
        this.processDefinitionId = processDefinitionId;
    }

    protected String processDefinitionId;

    @Autowired
    protected RuntimeService runtimeService;

    @Autowired
    protected EmpMapper empMapper;

    @Autowired
    protected TaskService taskService;

    @Autowired
    protected HistoryService historyService;

    @Autowired
    protected RepositoryService repositoryService;

    /**
     * 查询任务处理人信息
     */
    public Emp selectAssigneeEmp(String empId){
        QueryWrapper<Emp> wrapper = new QueryWrapper<Emp>().select("id,emp_name").eq("id", empId);
        return empMapper.selectOne(wrapper);
    }
}
